import 'package:flutter/material.dart';
import "package:get/get.dart";

class Help extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        body: Column(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: [
        Stack(
          children: [
            Container(
              child: Image.asset(
                'static/images/wenbangzhu.png',
                fit: BoxFit.fitWidth,
              ),
            ),
            Positioned(
              left: 8.0,
              top: 20,
              child: IconButton(
                onPressed: () {
                  Get.back();
                  print('object');
                },
                icon: Image.asset(
                  'static/images/back.png',
                  width: 22,
                  fit: BoxFit.fitWidth,
                ),
              ),
            ),
          ],
        ),
        Transform.translate(
            offset: Offset(0, -10), // 向左偏移20px，向上偏移10px
            child: Container(
              decoration: BoxDecoration(
                color: Color(0xffffffff),
                borderRadius: BorderRadius.circular(10.0),
              ),
              child: search(),
            )),
        // Padding(
        //     padding: EdgeInsetsDirectional.symmetric(horizontal: 15),
        //     child: Text('常见问题',
        //         style: TextStyle(fontSize: 16, fontWeight: FontWeight.w500))),
        Container(
          margin: EdgeInsets.only(top: 10, left: 15, right: 15),
          decoration: BoxDecoration(
              borderRadius: BorderRadius.circular(10),
              border: Border.all(color: Color(0xffdddddd))),
          child: Column(
            children: [

              for(var item in [])
              GestureDetector(
                onTap: () {
                  // 点击图片时的回调
                  Get.toNamed('/solution');
                  print("图片被点击了！");
                },
                child: Container(
                  margin: EdgeInsetsDirectional.symmetric(horizontal: 15),
                  padding: EdgeInsetsDirectional.symmetric(vertical: 10),
                  decoration: BoxDecoration(
                      border: Border(
                          bottom:
                              BorderSide(width: 1, color: Color(0xfff5f5f5)))),
                  child: Row(
                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
                    children: [
                      Text(
                        '猫猫为啥流泪',
                      ),
                      Icon(
                        Icons.chevron_right,
                        size: 20.0, // 你可以根据需要调整大小
                        color: Color(0xff2c2c2c), // 你可以根据需要调整颜色
                      )
                    ],
                  ),
                ),
              ),
            ],
          ),
        )
      ],
    ));
  }
}

// prefixIcon
Widget search() {
  return Container(
      margin: EdgeInsets.only(top: 15, left: 15, right: 15),
      decoration: BoxDecoration(
        color: Color(0xfff5f5f5),
        borderRadius: BorderRadius.circular(30.0),
        border: Border.all(color: Color(0xffffffff)),
      ),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        children: [
          Expanded(
            child: TextField(
              style: TextStyle(
                fontSize: 12.0, // 字体大小
              ),
              decoration: InputDecoration(
                contentPadding: EdgeInsets.symmetric(vertical: 16),
                prefixIcon: Icon(Icons.search, color: Colors.grey[500]!),
                hintText: '请输入常见问题',
                border: InputBorder.none,
                hintStyle: TextStyle(fontSize: 12, color: Color(0xff999999)),
              ),
            ),
          ),
        ],
      ));
}
